#ifndef CELLBASE_H
#define CELLBASE_H

#include <QFrame>
#include <QVariant>
#include "../../XXqtDefine.h"

class CellBase : public QFrame{
    Q_OBJECT
public:
    /* Note that deriver need use Q_INVOKABLE. */
    /* Q_INVOKABLE */CellBase(QWidget *parent = nullptr):QFrame(parent),_selected(false),_actived(false){}
    virtual ~CellBase(){}

    virtual void updateData(const QVariant &data){_data = data;}
    virtual void setData(const QVariant &data){_data = data;}
    virtual QVariant getData(){return _data;}
    virtual CellBase* ctor(QWidget *parent = nullptr) = 0;

signals:
    void sigEvent(QString name, QVariant info);
    void sigDataChanged();

    XX_PROPERTY_POLISH(bool,_selected,isSelected,setSelected)
    XX_PROPERTY_POLISH(bool,_actived,isActived,setActived)

private:
    virtual void polish() = 0;

private:
    QVariant _data;
};

#endif
